<?php
$oldName = $_FILES['file']['name'];
//echo $oldName;
$arr = explode('.',$oldName);
$newName = md5($oldName.time()).'.'.$arr[count($arr)-1];
move_uploaded_file($_FILES['file']['tmp_name'],'image'.$newName);
$img_url = 'image'.$newName;
?>
<html>
<body>
<h1>头像上传</h1>
你上传的头像是：<img src="<?php echo $img_url?>">
</body>
</html>